load(
    "//bazel:envoy_build_system.bzl",
    "envoy_cc_fuzz_test",
    "envoy_cc_mock",
    "envoy_package",
    "envoy_proto_library",
)

licenses(["notice"])  # Apache 2

envoy_package()

envoy_cc_mock(
    name = "ext_proc_mocks",
    hdrs = ["mocks.h"],
    deps = [
        "//source/extensions/filters/http/ext_proc:client_interface",
        "@envoy_api//envoy/service/ext_proc/v3:pkg_cc_proto",
    ],
)

envoy_proto_library(
    name = "ext_proc_unit_test_fuzz_proto",
    srcs = ["ext_proc_unit_test_fuzz.proto"],
    deps = [
        "//test/fuzz:common_proto",
        "@envoy_api//envoy/extensions/filters/http/ext_proc/v3:pkg",
        "@envoy_api//envoy/service/ext_proc/v3:pkg",
    ],
)

envoy_cc_fuzz_test(
    name = "ext_proc_unit_test_fuzz",
    srcs = ["ext_proc_unit_test_fuzz.cc"],
    corpus = "ext_proc_corpus",
    deps = [
        ":ext_proc_mocks",
        ":ext_proc_unit_test_fuzz_proto_cc_proto",
        "//source/extensions/filters/http/ext_proc:config",
        "//test/extensions/filters/http/common/fuzz:http_filter_fuzzer_lib",
        "//test/mocks/http:http_mocks",
        "//test/mocks/network:network_mocks",
    ],
)
